module Fastlane
  module Actions
    module SharedValues
      MAKE_FONT_CHARACTERS_CUSTOM_VALUE = :MAKE_FONT_CHARACTERS_CUSTOM_VALUE
    end

    class MakeFontCharactersAction < Action
      def self.run(params)
        # xc,suc,fail,enp,tf,jobs
        type = params[:typeName]
        res = ""
        if type == "xc" 
          res = xcodebuildCharacters
        elsif type == "suc"
          res = successCharacters
        elsif type == "fail"
          res = failureCharacters
        elsif type == "enp"
          res = enterpriseCharacters
        elsif type == "tf"
          res = testflightCharacters
        elsif type == "jobs"
          res = jobsCharacters
        elsif type == "appstore"
          res = appstoreCharacters
        else
        end
        return res
      end


      def self.jobsCharacters
          jobs = "============================================================================================================\n"
          jobs += "                                                                                                           \n
                                  K W W K j i i ; t t j i t i j f j t f j j f L D K W W W .                                 
                                  t W W K t ; , , , , ; ; , , : , i t f t j t f L G E K W # W                                 
                                  K W K E ; , : : : . : . . : : : : i i i i t j f G D K W # W i                                
                                D K W K f , : : . . . . .   . . . : : ; ; i i j f L G K W W W K                                
                              . K K K E i , : . .   .           . . : : , : ; t j L G E K W W W G                               
                              : W E W E , : . .                 . . . : . : , ; j f G E K W W W K                               
                              K K E E L , : . . .               . . . : . : , ; j L G D K W W K E D                              
                              W W D D f , : . . .               . . . . . : , ; f L D D K W W W K L                              
                              G E E D j , . . .                 . . . . : : , i j G D D E W W W W K                              
                              G E E E t , : . .               . . . . : . , ; t f G G D E W W W K E                              
                              D D D L t , . . .                 . . . . . : ; ; i f L D D K E W W K                              
                              f G D i i , : . .                 . . . . . : , ; i j f E E E E W W K                              
                              j D L i t , . . .                 .   . . . : : , ; t f D E K D E W K                              
                              G L L i i : . .                       . . . : : , , i f G E E E K W K ;                             
                            t D G j t j : . . .                     . . . . : : , ; j G E K W K W W f .                            
                          : E f W L i ; : . .                 . .   . . . . : , , ; t f E K K K W # # W                            
                          j W L D G j , : . . .             . . . . . . . : : , , , t f G K K W W # # K                            
                          t D t L G L , : , f j ; . . . . . . : : . . . : , , i t t G G E E K W W W W K                            
                          . t t i K E , : : : t K f j t , . : , : : : , t G D j f t E K K W K # K W W K                            
                            L D E E i , : : , : t L W K D G i : . . ; G E G K # W K D f K K K K W W W f                            
                            j E D L ; f : . : E i G W E L f i . . . i W D W j W D D K E f K K K K W W ,                            
                            ; E i f ; : . : , . . . ; , i ; , .   , t W W G t i t t E K D D E K K K W ;                            
                            ; G f t ; : , .   .     . : , : : . . . i i K t , : , ; j D t E K K E W W .                            
                              i f j ; :     .     . . : , . : . . : j D D L i , : , t i t G E K K K K                             
                              ; i j ; , . .         . . . . . .   . t L G f ; : : : : , i f E K E W E                             
                              , , ; i , : . .       . . : .   .   . t G j j ; , . . : ; , G K K E W D                             
                              ; , t t ; : . . . . . . . . . . .   . t G G t ; , : , i , f E W W K W E                             
                              . , i t i , . . . . . . . . . . .   . , G K G i , : , t t L K W W D E .                             
                                ; , ; f ; : : . . . . . . : . . . . i D E K t i ; ; t L G K K W E D                              
                                  , t j , , : . . . . . . . . . . . i D D W L i , ; t D E K W K E                               
                                  : ; i i ; : . . . . . : . . . . . ; E W W G t i i f D K W K E G                               
                                  . , , i ; : . . . . :     . . . : f # # W D j j j L K K K K E t                               
                                    ; ; ; : , : . . . . . . : i , t E # # K E G t L G E E E D E ,                               
                                    ; t i , : . . . . : : , , f G L L W # W E E G f L K D K K K                                
                                    . t , , , : . : , i , , i t t G E W K W W K W K G E L E K E                                
                                      , ; : : : . : j L t ; f f j E L G E E W # E G E D G K K E                                
                                      : ; i ; ; : , i D f t f f f L D E E W W K E i L L D K K L                                
                                        , ; , , : , f , . . . : : : ; t f D E E G j f D K K E                                 
                                        . , i i i i f . . . . : , ; t i j L E D f D D K K K W                                 
                                          ; j E f ; , : . : , i i L G D G D K E t D W K K E W .                                
                                          , j f i i , : . : , f t G f G D E D G ; D W K E W W W                                
                                            ; t f ; ; ; . . . : : : i j G G f j t W # # W # # # E                               
                                            L t f j , , : ; . : : , ; t L j ; ; G W W W # # # # # #                              
                                            j G t t t : : i , , ; , ; f t t , G E K W # # # # # # # #                             
                                            t j L j , ; . : ; i t j t L f i L E W # # # # # # # # # # # # # G .                        
                                            G t i G f , , , i t f . t E f j f W # # # # # # # # # # # # # # # # D .                      
                                            # t i t G G t t : : , , ; W D E W # # # # # # # # # # # # # # # # # # # # D                    
                                          E # E i j i L G i . . : , t # # # # # # # # # # # # # # # # # # # # # # # # # # D                  
                                        W W W # # W i i i t , . . . . : f # # # # # # # # # # # # # # # # # # # # # # # # # # # E                
                                      W # # # # # # # W t t j : . . . . : i # # # # # # # # # # # # # # # # # # # # # # # # # # # # E              
                                    , W # W # # # # # # # # # # : , . . . . . : i # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # t           
                                  W # W # # # # # # # # # # # : : . i .   .   . i t # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # j        
                                . W # # # # # # # W # # # # # # # : . . : ; . .     , j E # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # W L .   
                              E W # # # # # # # # W W # # # # # # : : . . . . . . . i G D # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # W E 
                            : # W # # # # # # # # # # W # # # # # # ; : . . , : : : , L D K # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # W
                          K # # # # # # # # # # # # # # W # # # # , ,   . . . ; , , i j E E W L # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
                        K # # # # # # # # # # # # # # W # # W # # ; : : : . . : t ; i i j G E W W W # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
                        \n"
          jobs += "               ============================================================================================================\n"  
          return jobs
        end

        def self.xcodebuildCharacters
            xc = "\n"
            xc += "                                             xcode build                           \n"
            xc += "                                \\  / __ .__..__ .___  .__ .  .._..   .__         \n"
            xc += "                                 >< /  `|  ||  \\[__   [__)|  | | |   |  \\        \n"
            xc += "                                /  \\\\__.|__||__/[___  [__)|__|_|_|___|__/        \n"
            xc += "\n"
            return xc
        end

        def self.testflightCharacters
          tf = "\n"
          tf += "                           _____ _____ ____ _____    _____ _     _  _____ _     _____              \n"
          tf += "                          /__ __Y  __// ___Y__ __\\  /    // \\   / \\/  __// \\ /|/__ __\\       \n"
          tf += "                            / \\ |  \\  |    \\ / \\    |  __\\| |   | || |  _| |_||  / \\         \n"
          tf += "                            | | |  /_ \\___ | | |    | |   | |_/\\| || |_//| | ||  | |         \n"
          tf += "                            \\_/ \\____\\\\____/ \\_/    \\_/   \\____/\\_/\\____\\\\_/ \\|  \\_/         \n"
          tf += "\n"
          return tf
        end

        def self.enterpriseCharacters
          enp = "\n"
          enp +="\n
                        #######                                                          
                        #       #    # ##### ###### #####  #####  #####  #  ####  ###### 
                        #       ##   #   #   #      #    # #    # #    # # #      #      
                        #####   # #  #   #   #####  #    # #    # #    # #  ####  #####  
                        #       #  # #   #   #      #####  #####  #####  #      # #      
                        #       #   ##   #   #      #   #  #      #   #  # #    # #      
                        ####### #    #   #   ###### #    # #      #    # #  ####  ######
                \n"
          return enp
        end

        def self.appstoreCharacters
          store = "\n"
          store += "\n
                            ________________________________________________________
                                __                       __                         
                                / |                    /    )                       
                            ---/__|------__------__----\\------_/_----__---)__----__-
                              /   |    /   )   /   )    \\     /    /   ) /   ) /___)
                            _/____|___/___/___/___/_(____/___(_ __(___/_/_____(___ _
                                     /       /                                      
                                    /       /                                       
                   \n"
          return store
        end

        def self.successCharacters
          suc = "\n"
          suc +="\n
                             .dMMMb  dMP dMP .aMMMb  .aMMMb  dMMMMMP .dMMMb  .dMMMb 
                            dMP\" VP dMP dMP dMP\"VMP dMP\"VMP dMP     dMP\" VP dMP\" VP 
                            VMMMb  dMP dMP dMP     dMP     dMMMP    VMMMb   VMMMb   
                          dP .dMP dMP.aMP dMP.aMP dMP.aMP dMP     dP .dMP dP .dMP   
                          VMMMP\"  VMMMP\"  VMMMP\"  VMMMP\" dMMMMMP  VMMMP\"  VMMMP\" 
                \n"
          return suc
        end

        def self.failureCharacters
          fails = "\n"
          fails += "\n
                                ######   ##   # #      #    # #####  ###### 
                                #       #  #  # #      #    # #    # #      
                                #####  #    # # #      #    # #    # #####  
                                #      ###### # #      #    # #####  #      
                                #      #    # # #      #    # #   #  #      
                                #      #    # # ######  ####  #    # ######
                   \n"
          return fails
        end


      def self.description
        "A short description with <= 80 characters of what this action does"
      end

      def self.details

        "You can use this action to do cool things..."
      end

      def self.available_options
        # Define all options your action supports.

        # Below a few examples
        [
          FastlaneCore::ConfigItem.new(key: :typeName,
                                       env_name: "FL_MAKE_FONT_CHARACTERS_TYPE",
                                       description: "创建字体的类型名,xc,suc,fail,enp,tf,jobs",
                                       ) 
        ]
      end

      def self.output

      end

      def self.return_value
        # If your method provides a return value, you can describe here what it does
      end

      def self.authors
        # So no one will ever forget your contribution to fastlane :) You are awesome btw!
        ["fengsh998@163.com"]
      end

      def self.is_supported?(platform)
        
        platform == :ios
      end
    end
  end
end
